// pages/craftsman/craftsman.js

Page({
    data: {
      data:[]
    },
    onLoad: function(options) {
      wx.request({
        url: 'http://localhost:2023/public/jiangren',
        method:"GET",
        success: res=> {
          console.log('success');
          console.log(res.data)
          this.setData({
            data:res.data
          })
        },
        fail: err=> {
          console.log(err)
        },
      })
    },
    toDetail: function (e) {
      console.log(e.currentTarget.id)
      wx.navigateTo({
        url: '/pages/mandetail/mandetail?id=' + e.currentTarget.id,
        success(){
          console.log('页面跳转成功')
        },
        fail: err=> {
          console.log(err)
        },
      })
    }
  })